#ifndef MOLECULAR_MOLECULAR_CORE_H
#define MOLECULAR_MOLECULAR_CORE_H

#include "molecular_basic_types.h"
#include "molecular_atom.h"
#include "molecular_atom_end_point.h"
#include <map>

namespace M {
    class Core
    {
        typedef std::map<String, Atom *> AtomList;

    public:
        Core();
        virtual ~Core();

        bool AddMCA(Atom *pAtom);
        bool RemoveMCA(Atom *pAtom);
        Atom * GetAtom(const String &strAtomId);

        bool FireEvent(int nEventId, void *pParams);
        bool FireEvent(const AtomEndPoint &oSrcAtom, int nEventId, void *pParams);

        bool Execute(const String &strAtomId, int nFuncId, void *pParams, void *pIOParams);
        bool Execute(const AtomEndPoint &oSrcAtom, const String &strAtomId, int nFuncId, void *pParams, void *pIOParams);

    private:
        AtomList m_vAtoms;
    };
}

#endif  // MOLECULAR_MOLECULAR_CORE_H